var t, a = require("../../../@babel/runtime/helpers/defineProperty"), e = getApp();

Page({
    data: (t = {
        listData: [],
        page: 1,
        finished: !1
    }, a(t, "listData", []), a(t, "name", ""), t),
    onLoad: function(t) {
        wx.setNavigationBarTitle({
            title: t.name
        }), this.setData({
            name: t.name
        }), this.getData();
    },
    onReady: function() {},
    onShow: function() {},
    getData: function() {
        var t = this;
        if (!this.data.finished) {
            var a = "存货明细" == this.data.name ? "plugin.stock-service.frontend.controllers.stock.logs" : "代销明细" == this.data.name ? "plugin.stock-service.frontend.controllers.help.logs" : "", s = e.getNetAddresss(a);
            e._getNetWork({
                url: s,
                data: {
                    page: this.data.page
                },
                success: function(a) {
                    if (1 !== a.data.result) return wx.showToast({
                        title: a.data.msg
                    }), !1;
                    var e, s = a.data.data, i = !1;
                    (0 === s.list.data.length || s.list.data.length < s.list.per_page || s.list.current_page === s.list.last_page) && (i = !0), 
                    e = t.data.listData.concat(s.list.data), t.setData({
                        finished: i,
                        listData: e,
                        page: ++t.data.page
                    });
                }
            });
        }
    },
    onReachBottom: function() {
        this.getData();
    }
});